<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>seatUpAudit 升舱审核</title>
	</head>
	<link rel="stylesheet" href="../css/common.css" />
	<style>
		body{
			background: #eeeeee;
		}
		.main{
			padding-top:28px;
			text-align:center;
		}
		input{
			height:27px;
			width:100px;
			border:1px solid #dadada;
			border-radius:3px;
			padding-left:10px;
			margin-left:10px;	
		}
		.main p{
			height:36px;
		}
		.btnBox{
			height:50px;
			width:100%;
			position:fixed;
			bottom:0;
			left:0;
			text-align:center;
		}
		.sure,.cancel{
			height:28px;
			padding:0 35px;
			background:#00aa98;
			border:none;
			border-radius:3px;
			color:white;
			cursor:pointer;
		}
		.cancel{
			margin-left:30px;
			background:#a1a4a9;
		}
		input[type=radio]{
			position:relative;
			top:5px;
			left:0px;
		}
	</style>
	<body>
		<div class='main'>
			<p>审核结论：<input checked type='radio' name='audit' value="3"/> 通过<input type='radio' name='audit'value="4"/> 不通过</p>	
			<p>升舱金额：<input class='unitPrice' type='text'/></p>
			<p>货币类型：<input class='baojia' type='text' readonly/></p>	
		</div>
		<div style='height:50px;'></div>
		<div class='btnBox'>
			<button class='sure'>确认</button>
			<button class='cancel'>取消</button>
		</div>
		<script type="text/javascript" src="../js/jquery-1.12.4.js" ></script>		
		<script type="text/javascript" src="../js/common.js" ></script>
		<script type="text/javascript" src="../layer-v2.4/layer/layer.js" ></script>
		<script>
			var baojia = getHref().baojia;
			$(".baojia").val(baojia);			
			$(".sure").click(function(){
				var exchId = getHref().exchId;
				var unitPrice = $(".unitPrice").val();					
				var status = $("input:radio[name='audit']:checked").val();
				if(status=="3"){
					inputCheckoutFun.price.normal(unitPrice,"升舱金额","为数字且小数精度不超过两位")
				}
				
				layer.confirm('确定审核？', {
				  	btn: ['确定','取消'] //按钮
				}, function(){
				 	sure();	
				});
				
				
				function sure(){
					layer.load();	
					 $.ajax({
						type:"post",
						url:"../orderAddon/auditExch?exchId="+exchId+"&unitPrice="+unitPrice+"&status="+status,
						contentType:'application/json;charset=utf-8',
						async:true,
						success:function(data){
							layer.closeAll('loading');
							var data=JSON.parse(data);								
							if(data.status.toString()=="1001"){
								layer.msg(data.message, {icon: 1,time:1000},function(){
									var index = parent.layer.getFrameIndex(window.name);//获取弹窗索引
									parent.layer.close(index);//关闭弹窗
								});			
							}else{
								layer.alert(data.message)
							}
						}
					});
				}
			})				
		//_______________________________________________________________取消按钮
			$(".cancel").click(function(){
				closeWin()
			})
		
		
		</script>
	</body>
</html>
